"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const taro_1 = require("@tarojs/taro");
const components_1 = require("@tarojs/components");
const taro_ui_1 = require("taro-ui");
const XDivider_1 = require("../../components/XDivider");
require("./index.scss");
class default_1 extends taro_1.Component {
    constructor() {
        super(...arguments);
        this.state = {
            isCurtainOpened: false
        };
        this.handleToPage = url => {
            taro_1.default.navigateTo({
                url
            });
        };
        this.onCurtainOpen = () => {
            this.setState(state => (Object.assign({}, state, { isCurtainOpened: true })));
        };
        this.onCurtainClose = () => {
            this.setState(state => (Object.assign({}, state, { isCurtainOpened: false })));
        };
    }
    render() {
        return (<components_1.View className='home-handle'>
      	<components_1.View className='btn-group'>
      		<components_1.Button onClick={this.handleToPage.bind(this, '/pages/my/goods/index')} size='mini' className='btn'>查看更多</components_1.Button>
      	</components_1.View>
      	<components_1.View className='link-group'>
      		<components_1.View onClick={this.handleToPage.bind(this, '/pages/home/apply/index')}>
        		<components_1.Text className='text'>我要上首页</components_1.Text>
        	</components_1.View>
        	<XDivider_1.default />
        	<components_1.View onClick={this.onCurtainOpen}>
        		<components_1.Text className='text'>关联小程序</components_1.Text>
        	</components_1.View>
      	</components_1.View>
        <taro_ui_1.AtCurtain isOpened={this.state.isCurtainOpened} onClose={this.onCurtainClose}>
          <components_1.View style={{ textAlign: 'center', color: '#fff' }}>
            <components_1.Text>暂时没有关联的小程序</components_1.Text>
          </components_1.View>
        </taro_ui_1.AtCurtain> 
      </components_1.View>);
    }
}
exports.default = default_1;
//# sourceMappingURL=index.jsx.map